/*
 Navicat Premium Data Transfer

 Source Server         : sqlservice
 Source Server Type    : SQL Server
 Source Server Version : 10501600
 Source Host           : macys.f3322.net:1433
 Source Catalog        : newhis
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 10501600
 File Encoding         : 65001

 Date: 17/11/2020 09:56:27
*/


-- ----------------------------
-- Table structure for zz_pay_order
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[zz_pay_order]') AND type IN ('U'))
	DROP TABLE [dbo].[zz_pay_order]
GO

CREATE TABLE [dbo].[zz_pay_order] (
  [order_id] varchar(32) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [sys_seqno] varchar(32) COLLATE Chinese_PRC_CI_AS  NULL,
  [order_title] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [order_description] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [amount] numeric(10,2)  NULL,
  [mchnt_cd] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [order_type] int  NULL,
  [payer_info] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [payer_channel] varchar(2) COLLATE Chinese_PRC_CI_AS DEFAULT ((0)) NULL,
  [state] varchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
  [create_date] datetime DEFAULT (getdate()) NULL,
  [pay_date] datetime  NULL,
  [sub_no] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [epay_rrn] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [expire_time] datetime  NULL,
  [code_url] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [apply_iss] varchar(20) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[zz_pay_order] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'订单号',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'order_id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'流水号',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'sys_seqno'
GO

EXEC sp_addextendedproperty
'MS_Description', N'金额',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'amount'
GO

EXEC sp_addextendedproperty
'MS_Description', N'商户号',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'mchnt_cd'
GO

EXEC sp_addextendedproperty
'MS_Description', N'订单类型 0=默认',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'order_type'
GO

EXEC sp_addextendedproperty
'MS_Description', N'支付方式',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'payer_channel'
GO

EXEC sp_addextendedproperty
'MS_Description', N'订单状态 1=等待支付 2=支付成功 3=退款 4=取消 5=其他',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'state'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'create_date'
GO

EXEC sp_addextendedproperty
'MS_Description', N'支付时间',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'pay_date'
GO

EXEC sp_addextendedproperty
'MS_Description', N'子商户订单号',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'sub_no'
GO

EXEC sp_addextendedproperty
'MS_Description', N'统一支付平台流水号',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'epay_rrn'
GO

EXEC sp_addextendedproperty
'MS_Description', N'订单失效时间',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'expire_time'
GO

EXEC sp_addextendedproperty
'MS_Description', N'二维码链接',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'code_url'
GO

EXEC sp_addextendedproperty
'MS_Description', N'支持的支付方式',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order',
'COLUMN', N'apply_iss'
GO

EXEC sp_addextendedproperty
'MS_Description', N'济宁银行支付订单表',
'SCHEMA', N'dbo',
'TABLE', N'zz_pay_order'
GO


-- ----------------------------
-- Records of zz_pay_order
-- ----------------------------
INSERT INTO [dbo].[zz_pay_order] VALUES (N'201117095008628135', N'201117095008628142', N'aaa', N'sss', N'.01', N'815370880620100', N'0', NULL, N'0', N'1', N'2020-11-17 09:50:08.630', NULL, N'1234567890152114555', N'80801027', N'2020-11-17 09:53:10.000', N'https://qr.95516.com/05374610/inf=D4E4DE5C1BB1A884DB0BE784EC782B5BFADE071308AC90E2CFA823AAB18451C5A', N'1000000110000')
GO

INSERT INTO [dbo].[zz_pay_order] VALUES (N'201117095308987159', N'201117095308988176', N'aaa', N'sss', N'.01', N'815370880620100', N'0', NULL, N'0', N'1', N'2020-11-17 09:53:08.987', NULL, N'1234567890152114556', N'83081248', N'2020-11-17 09:56:10.000', N'https://qr.95516.com/05374610/inf=DAF043B4DC3BD526ABE9D72856D9B3E19A30A1BF501E371FD89B52D832563A678', N'1000000110000')
GO


-- ----------------------------
-- Uniques structure for table zz_pay_order
-- ----------------------------
ALTER TABLE [dbo].[zz_pay_order] ADD CONSTRAINT [pk_order_id_no] UNIQUE NONCLUSTERED ([order_id] ASC, [sub_no] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table zz_pay_order
-- ----------------------------
ALTER TABLE [dbo].[zz_pay_order] ADD CONSTRAINT [PK__zz_pay_o__4659622926323865] PRIMARY KEY CLUSTERED ([order_id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO

